package me.sdevil507.supports.sequence;

import lombok.Data;

import javax.persistence.*;

/**
 * 序列池实体与获取序列号存储过程定义
 *
 * @author sdevil507
 */
@Entity
@Table(name = "common_sequence")
@Data
@NamedStoredProcedureQuery(
        name = "next_seq_no", procedureName = "next_seq_no", parameters = {
        @StoredProcedureParameter(mode = ParameterMode.IN, name = "seq_name", type = String.class),
        @StoredProcedureParameter(mode = ParameterMode.OUT, name = "seq_no", type = Long.class)
})
public class CommonSequence {

    /**
     * keyname指定序列名称
     */
    @Id
    @Column(length = 20)
    private String keyname;

    /**
     * 序列值
     */
    @Column
    private long value;

    /**
     * 备注
     */
    @Column
    private String remark;
}
